/* File: AboutDialog.java
 * $Author: junu.pv $
 * $LastChangedDate: 2010-05-01 08:31:01 +0000 (Sat, 01 May 2010) $
 * $Rev: 13 $
 * Licensed under GPL v3
 */
/*
 * AboutJDialog.java
 *
 * Created on 30-Apr-2010, 07:34:34
 */

package wiki2local;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

/**
 *
 * @author Junaid
 * @version 0.6
 * @since 0.5
 */
public class AboutDialog extends javax.swing.JDialog {

    /** Creates new form AboutJDialog */
    public AboutDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        this.addWindowListener(new WindowAdapter(){
            @Override
            public void windowClosing(WindowEvent event) {
                closeWindow();
            }
        });
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        okButton = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("About Wiki2Local");
        setResizable(false);

        okButton.setText("OK");
        okButton.setName(""); // NOI18N
        okButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                okButtonClicked(evt);
            }
        });

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/wiki2local/Logo.png"))); // NOI18N
        jLabel1.setText(String.format("<html><b>%s</b><br>Version: %s<br>Author: %s (%s)<br><br>%s</html>", System.getProperty("program.name"), System.getProperty("program.version"), System.getProperty("program.author"), System.getProperty("program.authorlink"), System.getProperty("program.description")));
        jLabel1.setVerticalAlignment(javax.swing.SwingConstants.TOP);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 356, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(okButton)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 105, Short.MAX_VALUE)
                    .addComponent(okButton))
                .addContainerGap())
        );

        okButton.getAccessibleContext().setAccessibleName("okButton");

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void okButtonClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_okButtonClicked
        this.setVisible(false);
        this.dispose();
    }//GEN-LAST:event_okButtonClicked

    public void closeWindow() {
        this.setVisible(false);
        this.dispose();
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JButton okButton;
    // End of variables declaration//GEN-END:variables

}
